//determine your daily caloric needs,
// use this nutritional needs calculator to find out how to break out those calories into carbohydrates, proteins and fats.
function calcNutrition () {
    var form = document.mod_calc;
    var totCal = form.totalCalories.value;
    if(!(checkValue(totCal))) {
        alert('Please enter a number for your daily caloric needs.');
    } else {
        form.minCarbs.value = Math.ceil((parseFloat(totCal) * .45));
        form.maxCarbs.value = Math.ceil((parseFloat(totCal) * .65));
        form.minCarbGrams.value = Math.ceil(form.minCarbs.value / 4);
        form.maxCarbGrams.value = Math.ceil(form.maxCarbs.value / 4);

        form.minProts.value = Math.ceil((parseFloat(totCal) * .1));
        form.maxProts.value = Math.ceil((parseFloat(totCal) * .35));
        form.minProtGrams.value = Math.ceil(form.minProts.value / 4);
        form.maxProtGrams.value = Math.ceil(form.maxProts.value / 4);

        form.minFats.value = Math.ceil((parseFloat(totCal) * .2));
        form.maxFats.value = Math.ceil((parseFloat(totCal) * .35));
        form.minFatGrams.value = Math.ceil(form.minFats.value / 9);
        form.maxFatGrams.value = Math.ceil(form.maxFats.value / 9);
    }
}

//To gain 1 pound a week, add 500 calories a day to your typical diet.
// That’s because 3,500 calories equals about 1 pound, and so 500 calories x 7 days = 3,500 calories
function caloriegainsneed(lbs)
{
    var calorieday=lbs*500;
    return lbs*3500;
}

//Calorie Calculator for Males         http://www.wvda.org/calcs/mcals.php
function FigureBEE(form, feet, inches, pounds, years, activity) {
    TotalInches = eval(feet*12) + eval(inches)
    Centis = TotalInches * 2.54
    Kilos = pounds/2.2
    Age = years
    Weight = 66 + (13.7 * Kilos)
    Height = 5 * Centis
    Ages = 6.8 * Age
    var activity = document.bee.activity.options[document.bee.activity.selectedIndex].value
   //     <option value="1.25"> Sedentary </option>
 //   <option value="1.3"> Lightly Active </option>
 //   <option value="1.5" selected=""> Moderately Active </option>
 //   <option value="1.7"> Very Active </option>
 //   <option value="2.0"> Extremely Active </option>
    form.calcval.value = (Math.round(Weight + Height - Ages) * activity)
}